package com.xiantm.study.thread.workthread.priactice.p2;



public class Channel {

    private final int MAX_REQUEST = 100;
    private int head;
    private int tail;
    private int count;
    private final Request[] requestQueue = new Request[MAX_REQUEST];
    private int thcount = 1;

    private long startTime = 0;

    public  void putRequest(Request request){

        new Thread(() -> request.execute()).start();
    }

    public synchronized void handle(Request request){
        request.execute();
        count--;
        notifyAll();
    }

}
